<?php

require_once '../include.php';

$objectid=$_REQUEST['objectid']?$_REQUEST['objectid']:null;
//var_dump($objectid);

$PG = new pgsql("gis24.jlu3s.com", "23456", "ccly", "sde", "GIScontest2024");  
$PG->connect();
if(!$PG){  
    $db_error = "无法连接到PostGreSQL数据库！";  
    echo $db_error;   
}else{ 
    $q1 = "DELETE FROM sde.sight where objectid='{$objectid}'";
    //var_dump($q1);
    $r1 = $PG->query($q1); 
    //var_dump($r1);
    $r11 = $PG->affectedRows();
    // echo $r11;
    // var_dump($r11);
    if($r11>0){  
        alertMes("删除成功！","sightList.php");       
    }else{
        alertMes("删除操作失败，请重试","sightList.php"); 
    }

}

?>